x86/ioapic: avoid gcc 4.6 warnings about uninitialised variables
authorIan Campbell <ian.campbell@citrix.com>
Mon, 16 May 2011 12:13:41 +0000 (13:13 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 16 May 2011 12:13:41 +0000 (13:13 +0100)
commit7ee854f17114f18b27d702a91729c23fa3224cd2
treef227393223be1b1f1ae115eab81d2c0fcd044da3
parentc3249bec9b0b6be84ed1dcd066e81fc22354ace5
x86/ioapic: avoid gcc 4.6 warnings about uninitialised variables

gcc 4.6 complains:
        io_apic.c: In function 'restore_IO_APIC_setup':
        /build/user-xen_4.1.0-3-amd64-zSon7K/xen-4.1.0/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/io_apic.h:150:26:
        error: '*((void *)&entry+4)' may be used uninitialized in this
        function [-Werror=uninitialized]
        io_apic.c:221:32: note: '*((void *)&entry+4)' was declared
        here
        /build/user-xen_4.1.0-3-amd64-zSon7K/xen-4.1.0/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/io_apic.h:150:26:
        error: 'entry' may be used uninitialized in this function
        [-Werror=uninitialized]
        io_apic.c:221:32: note: 'entry' was declared here
        cc1: all warnings being treated as errors

Add functions to read/write an entire IO APIC entry using an explicit
union to allow gcc to spot the initialisation.

Reported as Debian bug #625438, thanks to Matthias Klose.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/io_apic.c